package pl.koziczak.knowledgeintegration.model;

import java.util.ArrayList;
import java.util.List;

public class Class {
	private String name;
	private String fullPath;
	
	private List<Element> elements;
	private List<Class> subClasses;
	private Class parentClass;

	public Class() {
		elements = new ArrayList<Element>();
		subClasses = new ArrayList<Class>();
	}

	public void addElement(Element element) {
		if(elements==null)
			elements = new ArrayList<Element>();
		elements.add(element);
	}
	
	public void addSubClass(Class subClass) {
		if(subClasses==null)
			subClasses = new ArrayList<Class>();
		subClasses.add(subClass);
	}
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getFullPath() {
		return fullPath;
	}

	public void setFullPath(String fullPath) {
		this.fullPath = fullPath;
	}

	public List<Element> getElements() {
		return elements;
	}

	public void setElements(List<Element> elements) {
		this.elements = elements;
	}

	public List<Class> getSubClasses() {
		return subClasses;
	}

	public void setSubClasses(List<Class> subClasses) {
		this.subClasses = subClasses;
	}

	public Class getParentClass() {
		return parentClass;
	}

	public void setParentClass(Class parentClass) {
		this.parentClass = parentClass;
	}
	
	public String toString() {
		String result = "Class: [" + this.getName() +" " + this.getFullPath() +"]\n";
		for(Element e: this.elements)
			result +=e.toString();
		
		for(Class cl: subClasses)
			result += cl.toString();
		
		return result;
		
	}
}
